home *** CD-ROM | disk | FTP | other *** search
/ Champak 109 / Vol 109.iso / games / javelin.swf / scripts / __Packages / CJavelin.as next >
Text File  |  2008-11-12  |  1KB  |  70 lines

  1. class CJavelin
  2. {
  3.    function CJavelin()
  4.    {
  5.    }
  6.    function CRat()
  7.    {
  8.       this.angle = 89;
  9.       this.now_frm = 0;
  10.       this.dx = 0;
  11.       this.dy = 0;
  12.       this.rot_dr = 0;
  13.       this.now_rotat = 0;
  14.       this.start_vy = 0;
  15.       this.cnt_frm = 0;
  16.       this.step_metr = 2;
  17.    }
  18.    function SetDefault()
  19.    {
  20.       this.angle = 89;
  21.       this.now_frm = 0;
  22.       this.dx = 0;
  23.       this.dy = 0;
  24.       this.rot_dr = 0;
  25.       this.now_rotat = 0;
  26.       this.start_vy = 0;
  27.       this.cnt_frm = 0;
  28.       this.next_point = 0;
  29.       this.step_metr = 2;
  30.    }
  31.    function onTimer(st)
  32.    {
  33.       if(st == 2 || st == 3)
  34.       {
  35.          if(this.now_frm < 49)
  36.          {
  37.             this.now_frm = this.now_frm + 1;
  38.          }
  39.       }
  40.    }
  41.    function SetAngle()
  42.    {
  43.       this.angle = 89 - this.now_frm * 1.5;
  44.    }
  45.    function CalcPos(rx)
  46.    {
  47.       this.px = rx - this.now_frm;
  48.       this.py = 300;
  49.    }
  50.    function SetDxDy(sdx, sdy)
  51.    {
  52.       this.dx = sdx;
  53.       this.dy = sdy;
  54.    }
  55.    function SetTimeFly(tm)
  56.    {
  57.       this.timefly = tm;
  58.       this.fulltime = tm;
  59.    }
  60.    function SetAnglRotation(rt)
  61.    {
  62.       this.now_rotat = 76 - Math.floor(this.now_frm * 1.5);
  63.       this.rot_dr = rt;
  64.    }
  65.    function FlyRotation()
  66.    {
  67.       this.now_rotat += this.rot_dr;
  68.    }
  69. }
  70.